// 普通的 compose 函数
function compose(...funcs) {
  for (const func of funcs) {
    if (typeof func !== 'function') {
      return new TypeError('function master to be a function')
    }
  }
  if (funcs.length === 0) return rest => rest;
  if (funcs.length === 1) return funcs[0]
  return funcs.reduce((pre, cur) => (...rest) => pre(cur(...rest)))
}


